package cn.com.nes.mybatis.agent.ope.entity;

import cn.com.nes.mybatis.common.annotation.BusinessKey;
import cn.com.nes.mybatis.common.annotation.LogicDelete;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 设备协议表
 * </p>
 *
 * @author nes
 * @since 2023-02-28
 */
@TableName("is_device_protocol_info")
public class IsDeviceProtocolInfo extends Model<IsDeviceProtocolInfo> {

    private static final long serialVersionUID = 1L;

    /**
     * 设备协议id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 协议id
     */
    @TableField("protocol_id")
    @BusinessKey
    private String protocolId;
    /**
     * 设备厂商id
     */
    @TableField("manufacture_id")
    private String manufactureId;
    /**
     * 协议名称
     */
    private String name;
    /**
     * 实际数据起始位
     */
    @TableField("data_start")
    private Integer dataStart;
    /**
     * 采集串口数据时长 定长默认0s; 不定长,默认10s 
     */
    @TableField("serial_port_duration")
    private Integer serialPortDuration;
    /**
     * 无效值
     */
    @TableField("invalid_value")
    private String invalidValue;
    /**
     * 状态：是否发布  0：未发布；1：发布
     */
    @TableField("is_public")
    private Integer isPublic;
    /**
     * 状态：是否停用  0:停用；1:启用
     */
    @TableField("is_start")
    private Integer isStart;
    /**
     * 是否为plc类型的协议;0:普通协议;1:PLC协议;2-LORA协议
     */
    @TableField("is_plc")
    private Integer isPlc;
    /**
     * 逻辑删除  1 表示删除，0 表示未删除
     */
    @TableField("is_deleted")
    @LogicDelete
    private Integer isDeleted;
    /**
     * 创建人
     */
    @TableField("cr_oper")
    private String crOper;
    /**
     * 创建时间
     */
    @TableField("gmt_create")
    private Date gmtCreate;
    /**
     * 修改人
     */
    @TableField("up_oper")
    private String upOper;
    /**
     * 修改时间
     */
    @TableField("gmt_modified")
    private Date gmtModified;
    /**
     * 数据版本号  当前时间戳
     */
    private Long version;
    /**
     * 数据来源
     */
    private String sjly;
    /**
     * 协议字节类型：0双字节，1单字节
     */
    @TableField("single_double_bytes")
    private Integer singleDoubleBytes;
    /**
     * 修改内容备注
     */
    @TableField("modify_remarks")
    private String modifyRemarks;
    /**
     * 煤改电协议id
     */
    @TableField("ctce_protocol_id")
    private String ctceProtocolId;
    /**
     * 指令超时时间(单位:s): 默认10s
     */
    @TableField("query_interval_time")
    private Integer queryIntervalTime;
    /**
     * 指令失败后, 是否重复下发 1-是;0-否
     */
    @TableField("is_send_again")
    private Integer isSendAgain;
    /**
     * 设置的报警次数
     */
    @TableField("warningCnt")
    private Integer warningCnt;
    /**
     * 设置的报警时长 分钟
     */
    @TableField("warningTime")
    private Integer warningTime;
    /**
     * 控制验证方式 0 查询验证模式 1 协议验证
     */
    @TableField("ctrlCmdType")
    private Integer ctrlCmdType;
    /**
     * 波特率
     */
    private String bandrate;
    /**
     * 数据位
     */
    private String databit;
    /**
     * 校验位
     */
    private String checkbit;
    /**
     * 停止位
     */
    private String stopbit;
    /**
     * 协议类型：0-MODBUS、1-MQTT
     */
    @TableField("protocol_type")
    private Integer protocolType;
    /**
     * 协议发送控制指令超时时间，默认5秒
     */
    private Integer overtime;
    /**
     * 控制指令等待时间，单位秒，默认20
     */
    @TableField("control_wait_time")
    private Integer controlWaitTime;

    /**
     * 从机地址
     */
    @TableField("slave_address")
    private String slaveAddress;

    /**
     * 单条指令最大读取1-bit寄存器数量
     */
    @TableField("max_1_bit_register_read_count")
    private Integer max1BitRegisterReadCount;

    /**
     * 单条指令最大读取16-bit寄存器数量
     */
    @TableField("max_16_bit_register_read_count")
    private Integer max16BitRegisterReadCount;

    @TableField("agent_company_id")
    private String agentCompanyId;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getProtocolId() {
        return protocolId;
    }

    public void setProtocolId(String protocolId) {
        this.protocolId = protocolId;
    }

    public String getManufactureId() {
        return manufactureId;
    }

    public void setManufactureId(String manufactureId) {
        this.manufactureId = manufactureId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getDataStart() {
        return dataStart;
    }

    public void setDataStart(Integer dataStart) {
        this.dataStart = dataStart;
    }

    public Integer getSerialPortDuration() {
        return serialPortDuration;
    }

    public void setSerialPortDuration(Integer serialPortDuration) {
        this.serialPortDuration = serialPortDuration;
    }

    public String getInvalidValue() {
        return invalidValue;
    }

    public void setInvalidValue(String invalidValue) {
        this.invalidValue = invalidValue;
    }

    public Integer getIsPublic() {
        return isPublic;
    }

    public void setIsPublic(Integer isPublic) {
        this.isPublic = isPublic;
    }

    public Integer getIsStart() {
        return isStart;
    }

    public void setIsStart(Integer isStart) {
        this.isStart = isStart;
    }

    public Integer getIsPlc() {
        return isPlc;
    }

    public void setIsPlc(Integer isPlc) {
        this.isPlc = isPlc;
    }

    public Integer getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    public String getCrOper() {
        return crOper;
    }

    public void setCrOper(String crOper) {
        this.crOper = crOper;
    }

    public Date getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public String getUpOper() {
        return upOper;
    }

    public void setUpOper(String upOper) {
        this.upOper = upOper;
    }

    public Date getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(Date gmtModified) {
        this.gmtModified = gmtModified;
    }

    public Long getVersion() {
        return version;
    }

    public void setVersion(Long version) {
        this.version = version;
    }

    public String getSjly() {
        return sjly;
    }

    public void setSjly(String sjly) {
        this.sjly = sjly;
    }

    public Integer getSingleDoubleBytes() {
        return singleDoubleBytes;
    }

    public void setSingleDoubleBytes(Integer singleDoubleBytes) {
        this.singleDoubleBytes = singleDoubleBytes;
    }

    public String getModifyRemarks() {
        return modifyRemarks;
    }

    public void setModifyRemarks(String modifyRemarks) {
        this.modifyRemarks = modifyRemarks;
    }

    public String getCtceProtocolId() {
        return ctceProtocolId;
    }

    public void setCtceProtocolId(String ctceProtocolId) {
        this.ctceProtocolId = ctceProtocolId;
    }

    public Integer getQueryIntervalTime() {
        return queryIntervalTime;
    }

    public void setQueryIntervalTime(Integer queryIntervalTime) {
        this.queryIntervalTime = queryIntervalTime;
    }

    public Integer getIsSendAgain() {
        return isSendAgain;
    }

    public void setIsSendAgain(Integer isSendAgain) {
        this.isSendAgain = isSendAgain;
    }

    public Integer getWarningCnt() {
        return warningCnt;
    }

    public void setWarningCnt(Integer warningCnt) {
        this.warningCnt = warningCnt;
    }

    public Integer getWarningTime() {
        return warningTime;
    }

    public void setWarningTime(Integer warningTime) {
        this.warningTime = warningTime;
    }

    public Integer getCtrlCmdType() {
        return ctrlCmdType;
    }

    public void setCtrlCmdType(Integer ctrlCmdType) {
        this.ctrlCmdType = ctrlCmdType;
    }

    public String getBandrate() {
        return bandrate;
    }

    public void setBandrate(String bandrate) {
        this.bandrate = bandrate;
    }

    public String getDatabit() {
        return databit;
    }

    public void setDatabit(String databit) {
        this.databit = databit;
    }

    public String getCheckbit() {
        return checkbit;
    }

    public void setCheckbit(String checkbit) {
        this.checkbit = checkbit;
    }

    public String getStopbit() {
        return stopbit;
    }

    public void setStopbit(String stopbit) {
        this.stopbit = stopbit;
    }

    public Integer getProtocolType() {
        return protocolType;
    }

    public void setProtocolType(Integer protocolType) {
        this.protocolType = protocolType;
    }

    public Integer getOvertime() {
        return overtime;
    }

    public void setOvertime(Integer overtime) {
        this.overtime = overtime;
    }

    public Integer getControlWaitTime() {
        return controlWaitTime;
    }

    public void setControlWaitTime(Integer controlWaitTime) {
        this.controlWaitTime = controlWaitTime;
    }

    public static final String ID = "id";

    public static final String PROTOCOL_ID = "protocol_id";

    public static final String MANUFACTURE_ID = "manufacture_id";

    public static final String NAME = "name";

    public static final String DATA_START = "data_start";

    public static final String SERIAL_PORT_DURATION = "serial_port_duration";

    public static final String INVALID_VALUE = "invalid_value";

    public static final String IS_PUBLIC = "is_public";

    public static final String IS_START = "is_start";

    public static final String IS_PLC = "is_plc";

    public static final String IS_DELETED = "is_deleted";

    public static final String CR_OPER = "cr_oper";

    public static final String GMT_CREATE = "gmt_create";

    public static final String UP_OPER = "up_oper";

    public static final String GMT_MODIFIED = "gmt_modified";

    public static final String VERSION = "version";

    public static final String SJLY = "sjly";

    public static final String SINGLE_DOUBLE_BYTES = "single_double_bytes";

    public static final String MODIFY_REMARKS = "modify_remarks";

    public static final String CTCE_PROTOCOL_ID = "ctce_protocol_id";

    public static final String QUERY_INTERVAL_TIME = "query_interval_time";

    public static final String IS_SEND_AGAIN = "is_send_again";

    public static final String WARNINGCNT = "warningCnt";

    public static final String WARNINGTIME = "warningTime";

    public static final String CTRLCMDTYPE = "ctrlCmdType";

    public static final String BANDRATE = "bandrate";

    public static final String DATABIT = "databit";

    public static final String CHECKBIT = "checkbit";

    public static final String STOPBIT = "stopbit";

    public static final String PROTOCOL_TYPE = "protocol_type";

    public static final String OVERTIME = "overtime";

    public static final String CONTROL_WAIT_TIME = "control_wait_time";

    public static final String SLAVE_ADDRESS = "slave_address";

    public static final String MAX_16_BIT_REGISTER_READ_COUNT = "max_16_bit_register_read_count";

    public static final String MAX_1_BIT_REGISTER_READ_COUNT = "max_1_bit_register_read_count";

    @Override
    public Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "IsDeviceProtocolInfo{" +
        ", id=" + id +
        ", protocolId=" + protocolId +
        ", manufactureId=" + manufactureId +
        ", name=" + name +
        ", dataStart=" + dataStart +
        ", serialPortDuration=" + serialPortDuration +
        ", invalidValue=" + invalidValue +
        ", isPublic=" + isPublic +
        ", isStart=" + isStart +
        ", isPlc=" + isPlc +
        ", isDeleted=" + isDeleted +
        ", crOper=" + crOper +
        ", gmtCreate=" + gmtCreate +
        ", upOper=" + upOper +
        ", gmtModified=" + gmtModified +
        ", version=" + version +
        ", sjly=" + sjly +
        ", singleDoubleBytes=" + singleDoubleBytes +
        ", modifyRemarks=" + modifyRemarks +
        ", ctceProtocolId=" + ctceProtocolId +
        ", queryIntervalTime=" + queryIntervalTime +
        ", isSendAgain=" + isSendAgain +
        ", warningCnt=" + warningCnt +
        ", warningTime=" + warningTime +
        ", ctrlCmdType=" + ctrlCmdType +
        ", bandrate=" + bandrate +
        ", databit=" + databit +
        ", checkbit=" + checkbit +
        ", stopbit=" + stopbit +
        ", protocolType=" + protocolType +
        ", overtime=" + overtime +
        ", controlWaitTime=" + controlWaitTime +
        "}";
    }

    public String getSlaveAddress() {
        return slaveAddress;
    }

    public void setSlaveAddress(String slaveAddress) {
        this.slaveAddress = slaveAddress;
    }

    public Integer getMax1BitRegisterReadCount() {
        return max1BitRegisterReadCount;
    }

    public void setMax1BitRegisterReadCount(Integer max1BitRegisterReadCount) {
        this.max1BitRegisterReadCount = max1BitRegisterReadCount;
    }

    public Integer getMax16BitRegisterReadCount() {
        return max16BitRegisterReadCount;
    }

    public void setMax16BitRegisterReadCount(Integer max16BitRegisterReadCount) {
        this.max16BitRegisterReadCount = max16BitRegisterReadCount;
    }

    public String getAgentCompanyId() {
        return agentCompanyId;
    }

    public void setAgentCompanyId(String agentCompanyId) {
        this.agentCompanyId = agentCompanyId;
    }
}
